from races.models import Race
from races.models import Leg
from django.contrib import admin

class LegInline(admin.TabularInline):
    model = Leg
    extra = 1

class RaceAdmin(admin.ModelAdmin):
    list_display = ('name', 'start_date', 'end_date')
    inlines = [LegInline]

admin.site.register(Race, RaceAdmin)

